inspector: Allow picking children of GtkWidget classes
authorTimm Bäder <mail@baedert.org>
Wed, 24 May 2017 14:21:45 +0000 (16:21 +0200)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 20 Jul 2017 01:27:13 +0000 (21:27 -0400)
gtk/inspector/inspect-button.c

index 1b97dc5eb9554c39793a118248078c223aa1c862..7109d83d1ea01d44fd0ff2c22c66032bb6495121 100644 (file)
@@ -110,29 +110,25 @@ find_widget (GtkWidget      *widget,
       (data->x < new_allocation.x + new_allocation.width) &&
       (data->y < new_allocation.y + new_allocation.height))
     {
+      FindWidgetData new_data = *data;
       /* First, check if the drag is in a valid drop site in
        * one of our children 
        */
-      if (GTK_IS_CONTAINER (widget))
-        {
-          FindWidgetData new_data = *data;
-
-          new_data.x -= x_offset;
-          new_data.y -= y_offset;
-          new_data.found = FALSE;
-          new_data.first = FALSE;
-
-          for (child = gtk_widget_get_first_child (widget);
-               child != NULL;
-               child = gtk_widget_get_next_sibling (child))
-             {
-                find_widget (child, &new_data);
-             }
-
-          data->found = new_data.found;
-          if (data->found)
-            data->res_widget = new_data.res_widget;
-        }
+      new_data.x -= x_offset;
+      new_data.y -= y_offset;
+      new_data.found = FALSE;
+      new_data.first = FALSE;
+
+      for (child = gtk_widget_get_first_child (widget);
+           child != NULL;
+           child = gtk_widget_get_next_sibling (child))
+         {
+            find_widget (child, &new_data);
+         }
+
+      data->found = new_data.found;
+      if (data->found)
+        data->res_widget = new_data.res_widget;
 
       /* If not, and this widget is registered as a drop site, check to
        * emit "drag_motion" to check if we are actually in